program Problem5;

{$APPTYPE CONSOLE}

uses
  SysUtils;
  
type arr= array of integer;

var n: integer;
    i, j: integer;
    a: array of arr;

begin
  Read(n);
  Writeln;
  Setlength(a, n, n);

  For j:=0 to n-1 do
    a[0][j]:=1;
  For i:=0 to n-1 do
    a[i][i]:=1;

  For j:=1 to n-1 do
    For i:=1 to n-1 do
      a[i][j]:=a[i][j-1]+a[i-1][j-1];

  For j:=0 to n-1 do
  begin
    For i:=0 to n-1 do
      Write(a[i][j], ' ');
    Writeln; 
  end;


  Readln;
  Readln;
end.
